<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 199010120唐梓铭 -->
    <div id="app">
      <div>
        <label for="username">用户名</label>
        <input
          type="text"
          id="username"
          v-model="username"
          @keyup.enter="submit"
        />
      </div>
      <div>
        <label for="password">密码</label>
        <input
          type="password"
          id="password"
          v-model="password"
          @keyup.enter="submit"
        />
      </div>
      <div>
        <button @click="submit">登录</button>
      </div>
    </div>
    <script src="https://unpkg.com/vue@3"></script>
    <script>
      Vue.createApp({
        data() {
          return {
            username: "",
            password: "",
          };
        },
        methods: {
          submit() {
            if (this.username !== "admin" || this.password !== "123456") {
              alert("登录失败");
            } else {
              alert("登录成功");
            }
          },
        },
      }).mount("#app");
    </script>
  </body>
</html>
